package cn.school.test;

import cn.school.dao.ExamResultDao;
import cn.school.dao.StudentDao;
import cn.school.entity.ExamResult;
import cn.school.entity.Student;
import cn.school.util.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * @author oldliu
 * @since 1.0
 */
public class SearchResult {
    public static void main(String[] args) {
        SqlSession s= MyBatisUtil.get();
        ExamResultDao mapper = s.getMapper(ExamResultDao.class);
//        List<ExamResult> all = mapper.findALL();
//        all.stream().forEach(System.out::println);
        //ExamResult r=mapper.get(5L);
        ExamResult r=mapper.get2(5L);
        if(r!=null) {
            System.out.println(r);
            System.out.println("学生信息如下：" + r.getStu());
        }
        MyBatisUtil.close(s);
    }
}
